< previous page page_22 next page >

Page 22
for Wholesale customers, the Commission field must be left empty. You must remember these rules when adding, editing, and deleting data from the database, and you must remember these rules when creating reports.
This might seem to be a manageable task now, but try adding dozens more data fields (along with the exceptions), and you have quite a mess on your hands! Instead of establishing all data fields for all customers, what you need is a way to define only the fields you need for each type of customer. You can do this by setting up multiple tables in a single database and then setting up relationships between the tables.
In the example illustrated in Figure 2.6, you have added an additional data field: Type.
0022-01.jpg
Figure 2.6.
Using a qualifier field to establish a one-to-one relationship.
This data field qualifies, or describes, the type of customer stored in this data record. You can use this type of information to tell you where to look for additional information about the customer. For example, if the Type field is set to Retail, you know you can look for the customer in the Retail Table to find additional information. If the Type field is set to Wholesale, you can find additional information in the Wholesale Table.
By creating the RecordType field, you can establish a one-to-one relationship between records in the Customer Table and the Retail and Wholesale Tables.
One-to-Many Relationships
One-to-many relationships are used to link records in a master table (such as the Customer Table) to multiple records in another table.
For example, you can keep track of several orders for each customer in your database. If you were not creating a relational database, you would probably add a data field to your customer table called Order. This would contain the last order placed by this customer. But what if you

 
< previous page page_22 next page >

If you like this book, buy it!